<template>
    <div class="cart-bar">
        <div class="s-btn" @click="selectAll">
            <span v-if="selected" class="cubeic-right iconColor"></span>
            <span v-else class="cubeic-round-border"></span>
            <span style="font-size:15px;">全选</span>
        </div>
        <div class="prices">
            <span class="total">
                合计: <span class="totalPrice">¥{{total}}</span>
            </span>
            <span class="dec">
                已优惠: <span class="disPrice">¥{{desc}}</span>
            </span>
        </div>
        <radius-btn @click.native="commit" style="transform: scale(1.1);font-size: 0.32rem; border-radius: 5px;" txt="去结算" class="buy-btn" width="2rem;"
                    height="0.8rem"></radius-btn>
    </div>
</template>

<script>
    import radiusBtn from "@/components/base/radius-btn"

    export default {
        props: {
            desc: {

                default: 0
            },
            total: {

                default: 0
            },
            selected: null
        },
        data() {
            return {}
        },
        methods: {
            commit() {
                this.$emit('commit')
            },
            selectAll() {
                // this.selected = !this.selected
                this.$emit('selectAll')
            }
        },
        components: {
            radiusBtn
        }
    }
</script>

<style scoped lang="stylus">
    .cart-bar
        z-index 1
        position fixed
        left 0
        right 0
        bottom $bar-height
        height 50px
        padding 0 10px 0 18px
        display flex
        align-items center
        justify-content space-between
        background-color white

        .s-btn
            height 100%
            display flex
            align-items center
            justify-content flex-start
            span
                font-size 22px
                margin-right 5px
            .iconColor
                color #00D6C0

        .prices
            display flex
            flex-direction: column;
            margin-left: 44px;
            .dec
                color #333
                font-size 12px
                margin-top 5px
                white-space: nowrap;
            .total
                font-size 16px
                color #333
                white-space: nowrap;
                .disPrice
                    color #333
                    font-weight 500
                    span
                        font-size 9px
                .totalPrice
                    font-size 19px
                    color #00D6C0
                    font-weight 500
                    span
                        font-size 12px
                        font-weight 500

        .buy-btn
            flex 0 0 75px

</style>
